//
//  HeadCollectionViewTwo_material.m
//  ProjectA_LK
//
//  Created by 萌萌的小坤坤 on 16/6/16.
//  Copyright © 2016年 冷坤. All rights reserved.
//

#import "HeadCollectionViewTwo_material.h"
#import "UIImageView+WebCache.h"
@implementation HeadCollectionViewTwo_material
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self cratCollectionView:frame];
    }
    return self;
}
- (void)cratCollectionView:(CGRect)frame{
    self.imageViewPic = [[UIImageView alloc]initWithFrame:CGRectMake((frame.size.width - frame.size.width / 2) / 2, 10, frame.size.width / 2, frame.size.height / 5 * 2.5)];
    [self.contentView addSubview:self.imageViewPic];
    [_imageViewPic release];
    
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake((frame.size.width - frame.size.width / 2) / 2, self.imageViewPic.frame.origin.y + self.imageViewPic.frame.size.height, frame.size.width / 2, frame.size.height / 5 * 1)];
    self.titleLabel.font = [UIFont systemFontOfSize:13.0];
    self.titleLabel.textAlignment = 1;
    [self.contentView addSubview:self.titleLabel];
    [_titleLabel release];
    
}

- (void)setModels:(Hot *)models
{
    if (_models != models) {
        [_models release];
        _models = [models retain];
    }
    [self.imageViewPic sd_setImageWithURL:[NSURL URLWithString:models.pic]];
    self.titleLabel.text = models.name;
}


@end
